# -*- coding:utf-8 -*-
# Author:Ami
# @Time    : 2018/11/6 21:08

info = {
    "adc01": "hb",
    "adc02": "dg",
    "adc03": "xg"
}
# 删除
# del info["adc03"]
# info.pop("adc01")
# print(info)
b = {
    "adc01": "ccav",
    1: 2,
    "a": 233
}
print(info.get("adss"))  # key不存在不会报错
print("adc" in info)  # 判断key是否存在
info.update(b)  # 合并字典， key存在则修改，没有则添加
print(info)
print(info.items())
c = dict.fromkeys([6, 7, 8], [1, {"name": "alex"}, 444])  # 创建一个新字典 赋值，只能是一层 多层会分配指引
print(c)
c[7][1]["name"] = "ccav";
print(c)

for i in info:
    print(i, info[i])

av_catalog = {
    "欧美": {
        "www.youporn.com": ["很多免费的,世界最大的", "质量一般"],
        "www.pornhub.com": ["很多免费的,也很大", "质量比yourporn高点"],
        "letmedothistoyou.com": ["多是自拍,高质量图片很多", "资源不多,更新慢"],
        "x-art.com": ["质量很高,真的很高", "全部收费,屌比请绕过"]
    },
    "日韩": {
        "tokyo-hot": ["质量怎样不清楚,个人已经不喜欢日韩范了", "听说是收费的"]
    },
    "大陆": {
        "1024": ["全部免费,真好,好人一生平安", "服务器在国外,慢"]
    }
}
av_catalog["大陆"]["1024"][1] = "可以国内做镜像"
av_catalog.setdefault("taiwan", {"www.baidu.com": [1, 2]})  # 取到值返回，不然添加
print(av_catalog)
